<template>
  <div class="app-container">
    <div>
      <el-row :gutter="20">

        <el-col :span="6" :xs="24" class="bg-gray">
          <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
        </el-col>

        <el-col :span="18" :xs="24">
          <el-table
      :data="list"
      border
      style="width: 100%;margin-top:20px;">
      <el-table-column
        v-for="(item,index) in tableTitle"
        :key="index"
        :prop="item.prop"
        :label="item.label"
        sortable
      />
      <el-table-column
        prop="operate"
        label="操作"
        sortable
        width='150px'
      >
        <template slot-scope="scope">
          <el-button
            class="edit"
            size="mini"
            type="primary"
           >修改
          </el-button>
          <el-button
            class="edit"
            size="mini"
            type='danger'
            >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="pages"
      background
      layout="prev, pager, next"
      :total="1000">
    </el-pagination>
        </el-col>

      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Profile',
  data() {
    return {
      data: [{
          label: '一级 1',
          children: [{
            label: '二级 1-1',
            children: [{
              label: '三级 1-1-1'
            }]
          }]
        }, {
          label: '一级 2',
          children: [{
            label: '二级 2-1',
            children: [{
              label: '三级 2-1-1'
            }]
          }, {
            label: '二级 2-2',
            children: [{
              label: '三级 2-2-1'
            }]
          }]
        }, {
          label: '一级 3',
          children: [{
            label: '二级 3-1',
            children: [{
              label: '三级 3-1-1'
            }]
          }, {
            label: '二级 3-2',
            children: [{
              label: '三级 3-2-1'
            }]
          }]
        }],
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        tableTitle: [
            {
                label: 'id',
                prop: 'id'
            },
            {
                label: '岗位名称',
                prop: 'name'
            },
            {
                label: '说明',
                prop: 'des'
            }
        ],
        list: [
            {
                id: 1,
                name: '管理员',
                des: '管理员账号'
            }
        ],

    }
  },
  methods: {
     handleNodeClick(data) {
        console.log(data);
      }
  }
}
</script>
<style scoped>

</style>

